import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)


//所有的页面/模块，都在此导入
import Main from '../view/Main'     //主模块
import Login from '../view/system/Login'    //登录模块
import Home from '../view/system/Home'    //主页模块
import DataQuery from '../view/sports/DataQuery'    //数据查询
import DataAnalysis from '../view/sports/DataAnalysis'    //数据分析
import Walk from '../view/sports/query/Walk'   //走步数据
import WalkAnalysis from '../view/sports/analysis/WalkAnalysis' //走步分析
import WeightAnalysis from '../view/sports/analysis/WeightAnalysis'
import AfterSaleService from '../view/shop/AfterSaleService'
import CategoryManagement from '../view/shop/CategoryManag'
import FreightTemplate from '../view/shop/FreightTemplate'
import GoodsManag from '../view/shop/GoodsManag'
import OrderManag from '../view/shop/OrderManag'
import test from '../view/medical/test'
import HospitalManage from '../view/medical/HospitalManage'
import DepartmentManage from '../view/medical/DepartmentManage'
import DoctorManage from '../view/medical/DoctorManage'
import ColumnManage from '../view/content/ColumnManage'
import ConsultingManage from '../view/content/ConsultingManage'
import AuditManage from '../view/content/AuditManage'
import AdvertisingManage from '../view/content/AdvertisingManage'
import UserStatistics from '../view/data/UserStatistics'
import RegistrationStatistics from '../view/data/RegistrationStatistics'
import PhysicalExaminationStatistics from '../view/data/PhysicalExaminationStatistics'
import ConsultationStatistics from '../view/data/ConsultationStatistics'
import SalesStatistics from '../view/data/SalesStatistics'
import UserList from '../view/system/UserList'
import RoleManage from '../view/system/RoleManage'
import AccountManage from '../view/system/AccountManage'
import ClosureManage from '../view/system/ClosureManage'
import OperationLog from '../view/system/OperationLog'
import addAccount from "../view/system/account/addAccount";
import userDetail from "../view/system/user/userDetail";
import editUser from "../view/system/user/editUser";
import diseaseManage from "../view/medical/disease+manage/diseaseManage";
import diseaseAdd from "../view/medical/disease+manage/diseaseAdd";
import diseaseEdit from "../view/medical/disease+manage/diseaseEdit";
import editAccount from "../view/system/account/editAccount";
import addCategory from "../view/shop/category/addCategory";
import addCommodity from "../view/shop/commodity/addCommodity";
import editCategory from "../view/shop/category/editCategory";
import editCommodity from "../view/shop/commodity/editCommodity";
import showCategory from "../view/shop/category/showCategory";
import showCommodity from "../view/shop/commodity/showCommodity";
import LoginChatRoom from "../view/medical/chat_room/LoginChatRoom";
import ChatRoom from "../view/medical/chat_room/ChatRoom";
import consultDetail from "../view/content/consult/consultDetail";


//设置路由规则（映射）
//【特别重要：除了Login模块，其他模块都必须是Main模块的子模块】
//子模块以对象的方式添加在children数组中【注意，子模块的path属性不能添加“/”】


export default new Router({
  routes: [
    {
      path: '/',
      component: Login
    },
    {
      path: '/main',
      component: Main,
      children: [
        {
          path: 'home',
          component: Home
        },
        {
          path: 'data_query',
          component: DataQuery,
          children: [
            {
              path:'Walk',
              component: Walk
            }
          ]
        },
        /*{
          path: 'Walk',
          component: Walk
        },*/
        {
          path: 'data_analysis',
          component: DataAnalysis,
          children: [
            {
              path:'WalkAnalysis',
              component: WalkAnalysis
            },
            {
              path:'WeightAnalysis',
              component: WeightAnalysis
            }
          ]
        },
        {
          path: 'after_sale_service',
          component: AfterSaleService
        },
        {
          path: 'category_management',
          component: CategoryManagement
        },
        {
          path: 'freight_template',
          component: FreightTemplate
        },
        {
          path: 'goods_manage',
          component: GoodsManag
        },
        {
          path: 'order_manage',
          component: OrderManag
        },
        {
          path: 'test',
          component: test
        },
        {
          path: 'hospital_manage',
          component: HospitalManage
        },
        {
          path: 'department_manage',
          component: DepartmentManage
        },
        {
          path: 'doctor_manage',
          component: DoctorManage
        },
        {
          path: 'column_manage',
          component: ColumnManage
        },
        {
          path: 'consulting_manage',
          component: ConsultingManage
        },
        {
          path: 'audit_manage',
          component: AuditManage
        },
        {
          path: 'advertising_manage',
          component: AdvertisingManage
        },
        {
          path: 'user_statistics',
          component: UserStatistics
        },


        {
          path: 'registration_statistics',
          component: RegistrationStatistics
        },
        {
          path: 'physical_examination_statistics',
          component: PhysicalExaminationStatistics
        },
        {
          path: 'consultation_statistics',
          component: ConsultationStatistics
        },
        {
          path: 'sales_statistics',
          component: SalesStatistics
        },
        {
          path: 'user_list/:childName',
          component: UserList,
          props: true
        },
        {
          path: 'role_manage/:childName',
          component: RoleManage,
          props: true
        },
        {
          path: 'AccountManage/:childName',
          component: AccountManage,
          props: true
        },
        {
          path: 'ClosureManage/:childName',
          component: ClosureManage,
          props: true
        },
        {
          path: 'OperationLog/:childName',
          component: OperationLog,
          props: true
        },
        {
          path: 'addAccount/:childName',
          component: addAccount,
          props: true
        },
        {
          path: 'userDetail',
          component: userDetail
        },
        {
          path: 'userEdit',
          component: editUser
        },
        {
          path: 'disease',
          component: diseaseManage
        },
        {
          path: 'diseaseAdd',
          component: diseaseAdd,
        },
        {
          path: 'diseaseEdit',
          component: diseaseEdit
        },
        {
          component:editAccount,
          path: 'editAccount'
        },
        {
          path: 'addCategory',
          component: addCategory,
        },
        {
          path: 'editCategory',
          component: editCategory,
        },
        {
          path: 'addCommodity',
          component: addCommodity,
        },
        {
          path: 'editCommodity',
          component: editCommodity,
        },
        {
          path: 'showCommodity',
          component: showCommodity,
        },
        {
          path: 'showCategory',
          component: showCategory,
        },
        {
          path: 'login_chat_room',
          component: LoginChatRoom
        },
        {
          path: 'chat_room',
          component: ChatRoom
        },
        {
          path: 'consultDetail',
          component: consultDetail
        },
      ]

    }

  ]
})
